import UnitSpellEvent from '@/event/UnitSpellEvent';
import RandomUtil from '@/RandomUtil';
import PlayerUtil from '@/PlayerUtil';
export default class Item_狗头人的掘土铲 {
    static id = 'Agtc';
    static 释放(x: number, y: number, 来源?: unit, 目标?: unit, d?: any) {}
    constructor() {
        se.anyUnitSpellEvent(EVENT_PLAYER_UNIT_SPELL_FINISH, Item_狗头人的掘土铲.spellEffect, Item_狗头人的掘土铲.id);
    }
    static spellEffect(this: void, d: UnitSpellEvent) {
        let x = GetUnitX(d.trigUnit);
        let y = GetUnitY(d.trigUnit);
        let r = RandomUtil.randomPercent();
        if (r < 0.5) {
            let m = RandomUtil.nextInt(5, 300);
            PlayerUtil.addGoldState(GetOwningPlayer(d.trigUnit), m);
        } else if (r < 0.75) {
            // todo 奖励池
            CreateItem('tsv2', x, y);
        }
    }
}
